<#assign module="sys"/>

<@override name="header">
</@override>
<@override name="body">

    <div class="row">
        <div class="col-md-12">
            <div class="panel panel-default">
                <div class="panel-heading">
                    填写角色信息
                </div>
                <div class="panel-body">
                    <form id="submit_form" action="${ctx}/role/create" class="form-horizontal" method="post">

                        <div class="form-group">
                            <label class="col-sm-3 control-label"><em>*</em>角色名称：</label>
                            <div class="col-sm-3">
                                <input class="form-control" id="name" name="name" type="text" value="" required/>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-3 control-label"><em>*</em>角色权限：</label>
                            <div class="col-sm-7">
                                <h4>订单调度</h4>
                                <label style="padding-right:12px;">
                                    <input id="diaoduCheckBox" type="checkbox" value="dispatch" name="authorities"/> 调度
                                </label>
                                <br/>
                                <label id="zcLabel" style="padding-right:12px;display: none">
                                    <input id="zcCheckBox" type="checkbox" value="zhuancheDispatch" name="authorities"/>
                                    专车
                                </label>
                                <label id="zxLabel" style="padding-right:12px;display: none">
                                    <input id="zxCheckBox" type="checkbox" value="zhuanxianDispatch" name="authorities"/> 快车
                                </label>

                                <#if lineList??>
                                    <div id="linesCheckBoxDiv" style="display: none">
                                        <h5>请选择快车线路：</h5>
                                        <#list lineList as line>
                                            <label class="lines" style="padding-right:12px;">
                                                <input class="lineCheckBox" id="line${line.id}" type="checkbox" value="${line.id}" name="authorities">${line.name}
                                            </label>
                                        </#list>
                                    </div>
                                </#if>
                                <hr/>
                                <br/>
                                <h4>服务人员</h4>
                                <@shiro.isMainCompany>
                                <label style="padding-right:12px;">
                                    <input type="checkbox" value="driver" name="authorities"/> 查看
                                </label>
                                <label style="padding-right:12px;">
                                    <input type="checkbox" value="servicePersonal" name="authorities"/> 服务人员
                                </label>
                                <label style="padding-right:12px;">
                                    <input type="checkbox" value="driveredit" name="authorities"/> 编辑
                                </label>
                                <label style="padding-right:12px;">
                                    <input type="checkbox" value="driveradd" name="authorities"/> 入职
                                </label>
                                <label style="padding-right:12px;">
                                    <input type="checkbox" value="callLog" name="authorities"/> 通话记录
                                </label>
                                <label style="padding-right:12px;">
                                    <input type="checkbox" value="driverdelete" name="authorities"/> 删除
                                </label>
                                <label style="padding-right:12px;">
                                    <input type="checkbox" value="drivermoneyview" name="authorities"/> 账户明细
                                </label>
                                <label style="padding-right:12px;">
                                    <input type="checkbox" value="drivermoney" name="authorities"/> 账户充值
                                </label>
                                <label style="padding-right:12px;">
                                    <input type="checkbox" value="rate" name="authorities"/> 评价
                                </label>
                                <@zhuanxian>
                                    <label style="padding-right:12px;">
                                        <input type="checkbox" value="drivergrade" name="authorities"/> 服务人员等级
                                    </label>
                                </@zhuanxian>
                                <label style="padding-right:12px;">
                                    <input type="checkbox" value="driverapply" name="authorities"/> 审核
                                </label>
                                <label style="padding-right:12px;">
                                    <input type="checkbox" value="otherdriverlevel" name="authorities"/> 其他公司提成
                                </label>
                                <label style="padding-right:12px;">
                                    <input type="checkbox" value="notice" name="authorities"/> 查看服务人员通知
                                </label>
                                <label style="padding-right:12px;">
                                    <input type="checkbox" value="noticedelete" name="authorities"/> 删除服务人员通知
                                </label>
                                <label style="padding-right:12px;">
                                    <input type="checkbox" value="driversms" name="authorities"/> 服务人员短信通知群发
                                </label>
                                <label style="padding-right:12px;">
                                    <input type="checkbox" value="driverappnotice" name="authorities"/> 服务人员应用通知群发
                                </label>
                                <label style="padding-right:12px;">
                                    <input type="checkbox" value="announcement" name="authorities"/> 服务人员发布公告
                                </label>
                                </@shiro.isMainCompany>

                                <label style="padding-right:12px;">
                                    <input type="checkbox" value="usealldataDriver" name="authorities"/> 显示完整号码
                                </label>
                                <@shiro.isMainCompany>
                                <label style="padding-right:12px;">
                                    <input type="checkbox" value="driverenchashment" name="authorities"/> 服务人员申请提现
                                </label>
                                <label style="padding-right:12px;">
                                    <input type="checkbox" value="driverExport" name="authorities"/> 服务人员导出
                                </label>
                                <label style="padding-right:12px;">
                                    <input type="checkbox" value="driverloginrecord" name="authorities"/> 服务人员登录日志
                                </label>
                                </@shiro.isMainCompany>
                                <hr/>

                                <br/>
                                <h4>客户</h4>
                                <@shiro.isMainCompany>
                                    <label style="padding-right:12px;">
                                        <input type="checkbox" value="member" name="authorities"/> 查看
                                    </label>
                                    <label style="padding-right:12px;">
                                        <input type="checkbox" value="memberedit" name="authorities"/> 编辑
                                    </label>
                                    <label style="padding-right:12px;">
                                        <input type="checkbox" value="blacklist" name="authorities"/> 黑名单
                                    </label>
                                    <label style="padding-right:12px;">
                                        <input type="checkbox" value="membermoneyview" name="authorities"/> 账户明细
                                    </label>
                                    <label style="padding-right:12px;">
                                        <input type="checkbox" value="membermoney" name="authorities"/> 账户充值
                                    </label>
                                    <label style="padding-right:12px;">
                                        <input type="checkbox" value="memberapply" name="authorities"/> VIP申请
                                    </label>
                                    <label style="padding-right:12px;">
                                        <input type="checkbox" value="receipt" name="receipt"/> 发票管理
                                    </label>
                                    <label style="padding-right:12px;">
                                        <input type="checkbox" value="memberexport" name="authorities"/> 导出客户
                                    </label>
                                </@shiro.isMainCompany>
                                <label style="padding-right:12px;">
                                    <input type="checkbox" value="usealldata" name="authorities"/> 显示完整号码
                                </label>
                                <@shiro.isMainCompany>
                                    <label style="padding-right:12px;">
                                        <input type="checkbox" value="membernotice" name="authorities"/> 查看客户通知
                                    </label>
                                    <label style="padding-right:12px;">
                                        <input type="checkbox" value="membernoticedelete" name="authorities"/> 删除客户通知
                                    </label>
                                    <label style="padding-right:12px;">
                                        <input type="checkbox" value="membersms" name="authorities"/> 客户短信通知群发
                                    </label>
                                    <label style="padding-right:12px;">
                                        <input type="checkbox" value="memberappnotice" name="authorities"/> 客户应用通知群发
                                    </label>
                                </@shiro.isMainCompany>
                                <hr/>

                                <@shiro.isMainCompany>
                                    <br/>
                                    <h4>财务</h4>
                                    <label style="padding-right:12px;">
                                        <input type="checkbox" value="financial" name="authorities"/> 财务查看
                                    </label>
                                    <label style="padding-right:12px;">
                                        <input type="checkbox" value="financialadd" name="authorities"/> 财务添加
                                    </label>
                                    <label style="padding-right:12px;">
                                        <input type="checkbox" value="financialaudit" name="authorities"/> 财务审核
                                    </label>
                                    <label style="padding-right:12px;">
                                        <input type="checkbox" value="financialdelete" name="authorities"/> 财务删除
                                    </label>
                                    <label style="padding-right:12px;">
                                        <input type="checkbox" value="allowsign" name="authorities"/> 是否允许签单
                                    </label>
                                    <label style="padding-right:12px;">
                                        <input type="checkbox" value="modifycash" name="authorities"/> 修改订单金额
                                    </label>
                                    <hr/>
                                </@shiro.isMainCompany>
                                <@shiro.isMainCompany>
                                    <br/>
                                    <h4>营销</h4>
                                    <label style="padding-right:12px;">
                                        <input type="checkbox" value="couponrule" name="authorities"/> 优惠劵规则
                                    </label>
                                    <label style="padding-right:12px;">
                                        <input type="checkbox" value="activity" name="authorities"/> 活动
                                    </label>
                                    <label style="padding-right:12px;">
                                        <input type="checkbox" value="activitymanage" name="authorities"/> 活动信息
                                    </label>
                                    <label style="padding-right:12px;">
                                        <input type="checkbox" value="feedback" name="authorities"/> 反馈意见
                                    </label>
                                    <hr/>

                                    <br/>
                                    <h4>系统</h4>
                                    <label style="padding-right:12px;">
                                        <input type="checkbox" value="setting" name="authorities"/> 系统配置
                                    </label>
                                    <label style="padding-right:12px;">
                                        <input type="checkbox" value="appversion" name="authorities"/> 版本设置
                                    </label>
                                    <label style="padding-right:12px;">
                                        <input type="checkbox" value="operationlog" name="authorities"/> 操作日志
                                    </label>
                                    <label style="padding-right:12px;">
                                        <input type="checkbox" value="role" name="authorities"/> 角色设置
                                    </label>
                                    <label style="padding-right:12px;">
                                        <input type="checkbox" value="account" name="authorities"/> 用户管理
                                    </label>
                                    <label style="padding-right:12px;">
                                        <input type="checkbox" value="sms" name="authorities"/> 短信记录
                                    </label>
                                    <label style="padding-right:12px;">
                                        <input type="checkbox" value="smstemplet" name="authorities"/> 短信模板
                                    </label>
                                    <label style="padding-right:12px;">
                                        <input type="checkbox" value="area" name="authorities"/> 收费标准
                                    </label>
                                    <label style="padding-right:12px;">
                                        <input type="checkbox" value="level" name="authorities"/> 公司提成设置
                                    </label>
                                    <label style="padding-right:12px;">
                                        <input type="checkbox" value="memberrebate" name="authorities"/> 客户推荐提成
                                    </label>
                                    <label style="padding-right:12px;">
                                        <input type="checkbox" value="driverrebate" name="authorities"/> 服务人员推荐提成
                                    </label>
                                    <@jgpt>
                                        <label style="padding-right:12px;">
                                            <input type="checkbox" value="settle" name="authorities"/> 结算周期
                                        </label>
                                        <label style="padding-right:12px;">
                                            <input type="checkbox" value="feeScale" name="authorities"/> 监管平台收费标准
                                        </label>
                                    </@jgpt>
                                    <hr/>
                                </@shiro.isMainCompany>

                                <@zu>
                                    <h4>租车</h4>
                                    <label style="padding-right:12px;">
                                        <input type="checkbox" value="rentOrder" name="authorities"/> 查看
                                    </label>
                                    <label style="padding-right:12px;">
                                        <input type="checkbox" value="rentOrderUpdate" name="authorities"/> 编辑
                                    </label>
                                    <label style="padding-right:12px;">
                                        <input type="checkbox" value="rentOrderCancel" name="authorities"/> 销单
                                    </label>
                                    <label style="padding-right:12px;">
                                        <input type="checkbox" value="rentOrderFinance" name="authorities"/> 订单财务
                                    </label>
                                    <label style="padding-right:12px;">
                                        <input type="checkbox" value="car" name="authorities"/> 车辆管理
                                    </label>
                                    <label style="padding-right:12px;">
                                        <input type="checkbox" value="carType" name="authorities"/>车辆类型
                                    </label>
                                    <label style="padding-right:12px;">
                                        <input type="checkbox" value="brand" name="authorities"/> 车辆品牌
                                    </label>
                                    <hr/>
                                </@zu>

                                <@daijia>
                                    <h4>代驾</h4>
                                    <label style="padding-right:12px;">
                                        <input type="checkbox" value="orderrealtime" name="authorities"/> 时效
                                    </label>
                                    <label style="padding-right:12px;">
                                        <input type="checkbox" value="order" name="authorities"/> 订单
                                    </label>
                                    <label style="padding-right:12px;">
                                        <input type="checkbox" value="ordercreate" name="authorities"/> 添加订单
                                    </label>
                                    <label style="padding-right:12px;">
                                        <input type="checkbox" value="powercancel" name="authorities"/> 强制销单
                                    </label>
                                    <label style="padding-right:12px;">
                                        <input type="checkbox" value="powerrevoke" name="authorities"/> 强制收回
                                    </label>
                                    <label style="padding-right:12px;">
                                        <input type="checkbox" value="paidan" name="authorities"/> 派单
                                    </label>
                                    <label style="padding-right:12px;">
                                        <input type="checkbox" value="phonevisit" name="authorities"/> 回访
                                    </label>
                                    <label style="padding-right:12px;">
                                        <input type="checkbox" value="orderComplete" name="authorities"/> 完工
                                    </label>
                                    <label style="padding-right:12px;">
                                        <input type="checkbox" value="orderFixPrice" name="authorities"/> 订单定价
                                    </label>
                                    <hr/>
                                </@daijia>

                                <@pao>
                                    <h4>跑腿</h4>
                                    <label style="padding-right:12px;">
                                        <input type="checkbox" value="errand" name="authorities"/>订单
                                    </label>
                                    <label style="padding-right:12px;">
                                        <input type="checkbox" value="errandCreate" name="authorities"/>添加订单
                                    </label>
                                    <label style="padding-right:12px;">
                                        <input type="checkbox" value="errandPaidan" name="authorities"/>派单
                                    </label>
                                    <label style="padding-right:12px;">
                                        <input type="checkbox" value="errandCancel" name="authorities"/>强制销单
                                    </label>
                                    <label style="padding-right:12px;">
                                        <input type="checkbox" value="errandCallback" name="authorities"/>强制收回
                                    </label>
                                    <label style="padding-right:12px;">
                                        <input type="checkbox" value="errandOrderType" name="authorities"/>跑腿类型
                                    </label>
                                <#--
                                <label style="padding-right:12px;">
                                  <input type="checkbox" value="errandSet" name="authorities"/>设置收费
                                </label>
                                <label style="padding-right:12px;">
                                  <input type="checkbox" value="errandFixPrice" name="authorities"/>订单定价
                                </label>
                                -->
                                    <hr/>
                                </@pao>

                                <@shiro.isMainCompany>
                                <@zhuan>
                                    <br/>
                                    <h4>专车</h4>
                                    <label style="padding-right:12px;">
                                        <input type="checkbox" value="zhuan" name="authorities"/>订单
                                    </label>
                                    <label style="padding-right:12px;">
                                        <input type="checkbox" value="zhuanCreate" name="authorities"/>添加订单
                                    </label>
                                    <label style="padding-right:12px;">
                                        <input type="checkbox" value="zhuanPaidan" name="authorities"/>派单
                                    </label>
                                    <label style="padding-right:12px;">
                                        <input type="checkbox" value="zhuanCancel" name="authorities"/>强制销单
                                    </label>
                                    <label style="padding-right:12px;">
                                        <input type="checkbox" value="zhuanCallback" name="authorities"/>强制收回
                                    </label>
                                    <label style="padding-right:12px;">
                                        <input type="checkbox" value="zhuanCar" name="authorities"/>专车车辆
                                    </label>
                                    <label style="padding-right:12px;">
                                        <input type="checkbox" value="deleteZhuancheType" name="authorities"/>车型删除
                                    </label>
                                    <label style="padding-right:12px;">
                                        <input type="checkbox" value="zhuancheComplete" name="authorities"/> 后台完工
                                    </label>
                                <#--
                                <label style="padding-right:12px;">
                                  <input type="checkbox" value="zhuanSet" name="authorities"/>设置收费
                                </label>
                                -->
                                    <hr/>
                                </@zhuan>
                                </@shiro.isMainCompany>

                                <@freight>
                                    <@shiro.isMainCompany>
                                        <h4>货运</h4>
                                        <label style="padding-right:12px;">
                                            <input type="checkbox" value="freight" name="authorities"/>订单
                                        </label>
                                        <label style="padding-right:12px;">
                                            <input type="checkbox" value="freightCreate" name="authorities"/>添加订单
                                        </label>
                                        <label style="padding-right:12px;">
                                            <input type="checkbox" value="freightPaidan" name="authorities"/>派单
                                        </label>
                                        <label style="padding-right:12px;">
                                            <input type="checkbox" value="freightCancel" name="authorities"/>强制销单
                                        </label>
                                        <label style="padding-right:12px;">
                                            <input type="checkbox" value="freightCallback" name="authorities"/>强制收回
                                        </label>
                                        <label style="padding-right:12px;">
                                            <input type="checkbox" value="freightTruck" name="authorities"/>货运车辆
                                        </label>
                                        <label style="padding-right:12px;">
                                            <input type="checkbox" value="deleteFreightType" name="authorities"/>车型删除
                                        </label>
                                        <label style="padding-right:12px;">
                                            <input type="checkbox" value="freightOrderFixPrice" name="authorities"/> 订单定价
                                        </label>
                                        <hr/>
                                    </@shiro.isMainCompany>
                                </@freight>
                                <@zhuanxian>
                                    <br/>
                                    <h4>快车</h4>
                                    <label style="padding-right:12px;">
                                        <input type="checkbox" value="zhuanxian" name="authorities"/>订单
                                    </label>
                                    <label style="padding-right:12px;">
                                        <input type="checkbox" value="zhuanxianCreate" name="authorities"/>添加订单
                                    </label>
                                    <label style="padding-right:12px;">
                                        <input type="checkbox" value="zhuanxianPaidan" name="authorities"/>派单
                                    </label>
                                    <label style="padding-right:12px;">
                                        <input type="checkbox" value="zhuanxianCancel" name="authorities"/>强制销单
                                    </label>
                                    <label style="padding-right:12px;">
                                        <input type="checkbox" value="zhuanxianCallback" name="authorities"/>强制收回
                                    </label>
                                    <label style="padding-right:12px;">
                                        <input type="checkbox" value="zhuanxianCar" name="authorities"/>车辆
                                    </label>
                                    <@shiro.isMainCompany>
                                    <label style="padding-right:12px;">
                                        <input type="checkbox" value="zhuanxianLine" name="authorities"/>线路
                                    </label>
                                    <br/>
                                    </@shiro.isMainCompany>
                                    <div id="zxVehicleDiv" style="display: none;">
                                        <h5>车辆权限：</h5>
                                        <label style="padding-right:12px;">
                                            <input id="addZXVehicleBox" type="checkbox" value="addZXVehicle" name="authorities"/>新增车辆
                                        </label>
                                        <label style="padding-right:12px;">
                                            <input id="deleteZXVehicleBox" type="checkbox" value="deleteZXVehicle" name="authorities"/>删除车辆
                                        </label>
                                        <label style="padding-right:12px;">
                                            <input id="editZXVehicleBox" type="checkbox" value="editZXVehicle" name="authorities"/>编辑车辆
                                        </label>
                                    </div>

                                    <hr/>
                                </@zhuanxian>
                                <@partner>
                                    <@shiro.isMainCompany>
                                        <h4>合作商家</h4>
                                        <label style="padding-right:12px;">
                                            <input type="checkbox" value="partner" name="authorities"/> 查看
                                        </label>
                                        <label style="padding-right:12px;">
                                            <input type="checkbox" value="partnerUpdate" name="authorities"/> 修改商家
                                        </label>
                                        <label style="padding-right:12px;">
                                            <input type="checkbox" value="partnerDelete" name="authorities"/> 删除商家
                                        </label>
                                        <label style="padding-right:12px;">
                                            <input type="checkbox" value="intentAdd" name="authorities"/> 添加分类
                                        </label>
                                        <label style="padding-right:12px;">
                                            <input type="checkbox" value="intentUpdate" name="authorities"/> 修改分类
                                        </label>
                                        <label style="padding-right:12px;">
                                            <input type="checkbox" value="intentDelete" name="authorities"/> 删除分类
                                        </label>
                                        <hr/>
                                    </@shiro.isMainCompany>
                                </@partner>

                                <@gasstation>
                                    <@shiro.isMainCompany>
                                        <h4>加油站</h4>
                                        <label style="padding-right:12px;">
                                            <input type="checkbox" value="gasstation" name="authorities"/> 加油站
                                        </label>
                                        <label style="padding-right:12px;">
                                            <input type="checkbox" value="gasstationDelete" name="authorities"/> 删除加油站
                                        </label>
                                        <hr/>
                                    </@shiro.isMainCompany>
                                </@gasstation>

                                <br/>
                                <h4>其他</h4>
                                <@shiro.isMainCompany>
                                    <label style="padding-right:12px;">
                                        <input type="checkbox" value="company" name="authorities"/> 公司
                                    </label>
                                    <@workcar>
                                        <label style="padding-right:12px;">
                                            <input type="checkbox" value="workcar" name="authorities"/> 工作车
                                        </label>
                                    </@workcar>
                                    <label style="padding-right:12px;">
                                        <input type="checkbox" value="statistics" name="authorities"/> 统计
                                    </label>
                                    <@weixin>
                                        <label style="padding-right:12px;">
                                            <input type="checkbox" value="weixin" name="authorities"/> 微信
                                        </label>
                                    </@weixin>
                                    <label style="padding-right:12px;">
                                        <input type="checkbox" value="managertixian" name="authorities"/> 客户经理提现
                                    </label>
                                    <label style="padding-right:12px;">
                                        <input type="checkbox" value="download" name="authorities"/> APP
                                    </label>
                                </@shiro.isMainCompany>
                                <label style="padding-right:12px;">
                                    <input type="checkbox" value="bossreporting" name="authorities"/> 老板报表
                                </label>
                                <@shiro.isMainCompany>
                                    <label style="padding-right:12px;">
                                        <input type="checkbox" value="documenthelp" name="authorities"/> 帮助文档
                                    </label>
                                    <label style="padding-right:12px;">
                                        <input type="checkbox" value="insurance" name="authorities"/> 保险
                                    </label>
                                    <label style="padding-right:12px;">
                                        <input type="checkbox" value="news" name="authorities"/> 新闻
                                    </label>
                                </@shiro.isMainCompany>
                                <hr/>
                                <br/>
                                <h4>是否全选</h4>
                                <label>
                                    <input id="checkAll" type="checkbox"/> 全选
                                </label>
                                <hr>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-3 control-label">描述：</label>
                            <div class="col-sm-3">
                                <textarea class="form-control" cols="20" id="desc" name="desc" rows="2"></textarea>
                            </div>
                            <div class="col-sm-3">
                                <span id="tip4Intro"></span>
                            </div>
                        </div>

                        <div class="form-group" style="margin-left:10px;">
                            <label class="col-sm-3 control-label"></label>
                            <input type="submit" class="btn btn-primary" value="保存">
                            <input type="button" class="btn btn-default"
                                   onclick="window.location.href = '${ctx}/role/list';" value="返回">
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>

</@override>

<@override name="footer">
    <script type="text/javascript">
        $(document).ready(function () {
            //checkbox前端展示
            $('#diaoduCheckBox').change(function () {
                if (this.checked) {
                    $('#zcLabel,#zxLabel').css('display', 'inline');
                } else {
                    $('#zcLabel,#zxLabel,#linesCheckBoxDiv').css('display', 'none');
                    //所有子元素取消选中状态
                    $('#zxCheckBox,#zcCheckBox,.lineCheckBox').prop('checked', false);
                }
            })
            $('#zxCheckBox').change(function () {
                if (this.checked) {
                    $('#linesCheckBoxDiv').css('display', 'inline');
                } else {
                    $('#linesCheckBoxDiv').css('display', 'none');
                    $('.lineCheckBox').prop('checked', false);
                }
            })
            //全选
            $('#checkAll').change(function () {
                if (this.checked) {
                    $("input[name='authorities']").prop('checked', true).change();
                } else {
                    $("input[name='authorities']").prop('checked', false).change();
                }
            })

            //专线车辆相应权限
            $('input[value="zhuanxianCar"]').change(function(){
                if(this.checked){
                    $('#zxVehicleDiv').css('display','block');
                } else {
                    $('#zxVehicleDiv').css('display','none');
                    $('#addZXVehicleBox,#deleteZXVehicleBox,#editZXVehicleBox').prop('checked',false);
                }
            })
        })

    </script>
</@override>
<@extends name="../layout.ftl"/>
